package com.axun.ckz.yytmanager.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.view.Window;
import android.view.WindowManager;

import com.axun.ckz.yytmanager.R;
import com.axun.ckz.yytmanager.base.BaseActivity;
import com.axun.ckz.yytmanager.presenter.WelcomePresenter;
import com.axun.ckz.yytmanager.util.StatusBarUtil;
import com.axun.ckz.yytmanager.view.WelcomeView;

public class WelComeActivity extends BaseActivity implements WelcomeView{

    private WelcomePresenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        StatusBarUtil.setTranslucent(this);
        setContentView(R.layout.activity_welcome);
        presenter = new WelcomePresenter(getContext(),this);
        presenter.intentTo();
    }

    @Override
    public void toMain() {
        toClass(MainActivity.class);
    }

    @Override
    public void toLogin() {
        toClass(LoginActivity.class);
    }

    private void toClass(final Class clazz){
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(getContext(),clazz));
                finish();
            }
        },2000);
    }
}
